<template>
  <div class="main-header">
    <div class="main-icon" @click="changingFlod">
      <el-icon size="28">
        <component :is="isFold ? 'Expand' : 'Fold'" />
      </el-icon>
    </div>
    <div class="content">
      <div class="breadcrumb">
        <header-crumb />
      </div>
      <div class="info">
        <header-info />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import headerInfo from './cpns/header-info.vue'
import headerCrumb from './cpns/header-crumb.vue'
import { ref } from 'vue'
const isFold = ref(false)
const emit = defineEmits(['foldChange'])
// 把状态传给父组件
function changingFlod() {
  isFold.value = !isFold.value
  emit('foldChange', isFold.value)
}
</script>

<style lang="less" scoped>
.main-header {
  height: 100%;
  display: flex;
  align-items: center;
  .main-icon {
    margin-right: 15px;
  }
  .content {
    flex: 1;
    display: flex;
    justify-content: space-between;
  }
  .breadcrumb {
    display: flex;
    align-items: center;
  }
}
@media screen and (max-width: 768px) {
  .header-info {
    display: none;
  }
}
</style>
